<?php

class Panel extends Controller {
	function index() {
		$username = $this->session->get('Username');
		$workdir = $this->session->get('Workdir');
		
		$arrayfile = $this->PanelModel->DirDisplay($workdir);
		
		$this->set('title','GITBOX-DirPanel');
		$this->set('username', $username);
		$this->set('arrayfile', $arrayfile);
	}
	function filerepository($pathdir) {
		$username = $this->session->get('Username');
		$workdir = $this->session->get('Workdir');
		$workdir = $workdir ."/" .$pathdir;
		$arrayfile = $this->PanelModel->FileDisplay($workdir);
		
		$this->set('title','GITBOX-FilePanel');
		$this->set('username', $username);
		$this->set('arrayfile', $arrayfile);
	}
	
	function logout(){
		$this->session->destroy();
		$this->redirect(BASE_PATH.'/home/index');
	}
}
